home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
EARCD
/
comm
/
fido
/
CrashMail125.lha
/
CrashMail
/
StatsFormat.doc
< prev
next >
Wrap
Text File
|
1996-12-20
|
11KB
|
216 lines
CrashMail Statistics file format 1.1
15-Dec-95
Introduction
============
In this file, the format of CrashMail's statistics file is described.
With this text and a little programming knowledge, you can easily make
your own programs that uses the stats file. You can for example make
a better replacement for CrashStats or a program that calculates how
much each node has to pay if you are a node that uses cost-sharing
baes on how much echomail the nodes get from you.
There are two basic rules that you should obey:
1) Do NOT alter the file!
2) If the file isn't in the expected format, warn the user and
quit the program nicely.
The new format
==============
As of CrashMail 1.2, CrashMail uses a new format for its statistics file.
The main reason for the change is that CrashMail now keeps the number of
messages arrived in each area for the last 7 days. Things like the aka
and group of the area have also been added to the statistics file to
make it possible to make better external programs that read the file.
The node statistics have not been changed at all.
File format
===========
Basic file format
-----------------
+---------+--------------------------------------------------------+
| Size | Description |
+---------+--------------------------------------------------------+
| 4 bytes | Always the string "CST2". These four characters tell |
| | you what kind of file it is. If the these four |
| | characters aren't "CST2", your program should give an |
| | error and quit nicely. |
+---------+--------------------------------------------------------+
| 4 bytes | A longword that contains the day the statistics file |
| | was written. This is stored as days since Jan. 1, 1978 |
| | which is the same way AmigaDOS stores the date in |
| | datestamps . |
+---------+--------------------------------------------------------+
| 4 bytes | A longword that tells you how many areas there are in |
| | this file. |
+---------+--------------------------------------------------------+
| ??? | The statistics for the areas. The format of these |
| | sections are described below. There are as many |
| | structures as specified with the previous four bytes. |
+---------+--------------------------------------------------------+
| 4 bytes | A longword that tells you how many nodes there are in |
| | this file. |
+---------+--------------------------------------------------------+
| ??? | The statistics for the nodes. The format of these |
| | sections are described below. There are as many |
| | structures as specified with the previous four bytes. |
+---------+--------------------------------------------------------+
Area statistics format
----------------------
+-----------+--------------------------------------------------------+
| Size | Description |
+-----------+--------------------------------------------------------+
| 80 bytes | The tagname of the area |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the zone number of the aka |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the net number of the aka |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the node number of the aka |
+-----------+--------------------------------------------------------+
| 2 bytes | A word that contains the point number of the aka |
+-----------+--------------------------------------------------------+
| 1 byte | The group of the area ("A"-"Z") or zero if no group |
| | is specified for this areas. |
+-----------+--------------------------------------------------------+
| 1 byte | Not used. This byte exists to make sure that the next |
| | item is on an even offset in the file to make it |
| | easier to read this file when programming in C |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of texts you |
| | have received in this area. (Dupes are excluded) |
+-----------+--------------------------------------------------------+
| 8*2 bytes | 8 words that contain the number of messages that have |
| | arrived in this area for the last 8 days. The first |
| | word contains the number of messages that had arrived |
| | so far the day the file was written, the second word |
| | contains the number of messages that had arrived the |
| | day before that etc. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of dupes |
| | that CrashMail has found in this area. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the day since Jan. 1, 1978 |
| | that you first received messages in this area. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the minutes since midnight |
| | the first time you received messages in this area. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the "ticks" (50 ticks are |
| | one second) since the last whole minute the first time |
| | you received messages in this area. The three last |
| | fields together are a normal AmigaDOS datestamp. |
+-----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the last date you received |
| | messages in this area. This is stored as days since |
| | Jan. 1, 1978 which is the same way AmigaDOS stores the |
| | date in datestamps. |
+-----------+--------------------------------------------------------+
struct DiskAreaStats
{
ULONG TotalTexts;
UWORD Last8Days[8];
ULONG Dupes;
struct DateStamp FirstTime;
ULONG LastDay;
};
Node statistics format
----------------------
+----------+--------------------------------------------------------+
| Size | Description |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the zone number of the node |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the net number of the node |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the node number of the node |
+----------+--------------------------------------------------------+
| 2 bytes | A word that contains the point number of the node |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of netmails |
| | you have received from this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total size of all the |
| | netmails you have received from this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of netmails |
| | you have sent to this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total size of all the |
| | netmails you have sent to this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of echomails |
| | you have received from this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total size of all the |
| | echomails you have received from this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of echomails |
| | you have sent to this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total size of all the |
| | echomails you have sent to this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the total number of dupes |
| | you have received from this node. |
+----------+--------------------------------------------------------+
| 4 bytes | A longword that contains the first date you received |
| | anything from this node or sent anything to this node. |
| | This is stored as days since Jan. 1, 1978 which is the |
| | same way AmigaDOS stores the date in datestamps. |
+----------+--------------------------------------------------------+
Structures for C programmers
============================
Here they are, ready to be used! You have to include exec/types.h
to get the ULONG/UBYTE definitions.
struct DiskAreaStats
{
UBYTE Tagname[80];
struct Node4D Aka;
UBYTE Group;
UBYTE fill_to_make_even; /* Just ignore this one */
ULONG TotalTexts;
UWORD Last8Days[8];
ULONG Dupes;
struct DateStamp FirstTime;
ULONG LastDay;
};
struct Node4D
{
UWORD Zone,Net,Node,Point;
};
struct DiskNodeStats
{
struct Node4D Node;
ULONG GotNetmails;
ULONG GotNetmailBytes;
ULONG SentNetmails;
ULONG SentNetmailBytes;
ULONG GotEchomails;
ULONG GotEchomailBytes;
ULONG SentEchomails;
ULONG SentEchomailBytes;
ULONG Dupes;
ULONG FirstDay;
};